<%inherit file="/base/base-index.mako"/>
<%!
import math
%>
<%def name="title()">${c.news.title}</%def>

<div>

    <h2>
        % if c.news.class_id == 1:
            <img width="32px" height="32px" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Nuvola_Green_Plus.svg/128px-Nuvola_Green_Plus.svg.png" />
        % elif c.news.class_id == -1:
            <img width="32px" height="32px" src="http://icons.mysitemyway.com/wp-content/gallery/simple-red-square-icons-symbols-shapes/129883-simple-red-square-icon-symbols-shapes-minimize.png" />
        % else:
            <img width="32px" height="32px" src="http://www.clker.com/cliparts/1/3/e/6/1194989228908147779led_circle_grey.svg.med.png" />
        % endif
        <small>[<b>${c.news.reads}</b>]</small>
            -
         <a href="${c.news.link}">${c.news.title}</a>
    </h2>
    <small>${c.news.excerpt}</small><br/><br/>

    <div>${c.news.content.replace("\n", "<br/>")}</div><br/>
    <small><div>${c.news.content_normalized}</div></small><br/>
    % if True:
        <h3>Tags:</h3>
    	% for t in c.news.tags:
            "${t.name}" -
        % endfor

        <h2>Words</h2>

        % for w in c.news.words:
            <small>${w.count} - ${w.word.word}</small><br/>
        % endfor
    % endif
</div>

<%def name="rightcontent()">
<h2>BOW Tf-Idf</h2>
<ul>
	% for r in c.kernel_results_0:
        <li>
            % if c.news_data[r.news_id_2][1] == 1:
                <img width="20px" height="20px" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Nuvola_Green_Plus.svg/128px-Nuvola_Green_Plus.svg.png" />
            % elif c.news_data[r.news_id_2][1] == -1:
                <img width="20px" height="20px" src="http://icons.mysitemyway.com/wp-content/gallery/simple-red-square-icons-symbols-shapes/129883-simple-red-square-icon-symbols-shapes-minimize.png" />
            % else:
                <img width="20px" height="20px" src="http://www.clker.com/cliparts/1/3/e/6/1194989228908147779led_circle_grey.svg.med.png" />
            % endif
            <font size="${math.log(r.similarity * 100, 2)}">${round(r.similarity, 3)} - </font>
             <small>[<b>${c.news_data[r.news_id_2][2]}</b>]</small>
            <font size="${math.log(r.similarity * 80, 2)}"><a href="/news/news?news_id=${r.news_id_2}">${c.news_data[r.news_id_2][0]}</a></font>
        </li>
    % endfor
</ul>

<h2>n-grams</h2>
<ul>
	% for r in c.kernel_results_1:
        <li>
            % if c.news_data[r.news_id_2][1] == 1:
                <img width="20px" height="20px" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Nuvola_Green_Plus.svg/128px-Nuvola_Green_Plus.svg.png" />
            % elif c.news_data[r.news_id_2][1] == -1:
                <img width="20px" height="20px" src="http://icons.mysitemyway.com/wp-content/gallery/simple-red-square-icons-symbols-shapes/129883-simple-red-square-icon-symbols-shapes-minimize.png" />
            % else:
                <img width="20px" height="20px" src="http://www.clker.com/cliparts/1/3/e/6/1194989228908147779led_circle_grey.svg.med.png" />
            % endif
            <font size="${math.log(r.similarity * 100, 2)}">${round(r.similarity, 3)} - </font>
            <small>[<b>${c.news_data[r.news_id_2][2]}</b>]</small>
            <font size="${math.log(r.similarity * 80, 2)}"><a href="/news/news?news_id=${r.news_id_2}">${c.news_data[r.news_id_2][0]}</a></font>
        </li>
    % endfor
</ul>

<h2>Smitran-Ssk</h2>
<ul>
	% for r in c.kernel_results_2:
        <li>
            % if c.news_data[r.news_id_2][1] == 1:
                <img width="20px" height="20px" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Nuvola_Green_Plus.svg/128px-Nuvola_Green_Plus.svg.png" />
            % elif c.news_data[r.news_id_2][1] == -1:
                <img width="20px" height="20px" src="http://icons.mysitemyway.com/wp-content/gallery/simple-red-square-icons-symbols-shapes/129883-simple-red-square-icon-symbols-shapes-minimize.png" />
            % else:
                <img width="20px" height="20px" src="http://www.clker.com/cliparts/1/3/e/6/1194989228908147779led_circle_grey.svg.med.png" />
            % endif
            <font size="${math.log(r.similarity * 100, 2)}">${round(r.similarity, 3)} - </font>
            <small>[<b>${c.news_data[r.news_id_2][2]}</b>]</small>
            <font size="${math.log(r.similarity * 80, 2)}"><a href="/news/news?news_id=${r.news_id_2}">${c.news_data[r.news_id_2][0]}</a></font>
            <small>
				k: ${int(r.param1)},
				d: ${(r.param2)},
				o: ${(r.param3)},
				smit: ${(r.param4)}
			</small>
        </li>
    % endfor
</ul>
</%def>
